package net.lzzy.practices.entities;

import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

/**
 *@author lzzy_gxy on 2022/5/8.
 *Description:
 */
@Entity
@Setter
@Getter
public class Applicant extends BaseEntity{
    @Transient
    public static final int TYPE_APPLYING=0;
    @Transient
    public static final int TYPE_APPROVED=1;
    @Transient
    public static final int TYPE_DECLINED=2;
    private int status;
    @ManyToOne
    private User student;
    @ManyToOne
    private Course course;
    @Temporal(TemporalType.TIMESTAMP)
    private Date applyTime;

    public Applicant(){
        applyTime=new Date();
    }

    @JsonBackReference
    public User getStudent() {
        return student;
    }

    @JsonBackReference
    public Course getCourse() {
        return course;
    }
}
